import request from '@/utils/request'

/**
 * @description: 获取下拉员工数据
 * @param {*}
 * @return {*}
 */
export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple'
  })
}
export function getEmployees(params) {
  return request({
    url: '/sys/user',
    method: 'get',
    params
  })
}
export function addEmployees(data) {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}
export function delEmployees(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'

  })
}

// 批量导入员工
export function importEmployees(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data

  })
}

export function saveUserDetailById(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data

  })
}

export function getJobDetail(id) {
  return request({
    url: `/employees/${id}/jobs`,
    method: 'get'

  })
}

export function assignRoles(data) {
  return request({
    url: `/sys/user/assignRoles`,
    method: 'put',
    data

  })
}
